package com.kern.academic.service;

import com.alibaba.fastjson.JSONArray;
import com.kern.academic.bean.ResponseResult;
import com.kern.academic.dto.RightsDTO;
import com.kern.academic.dto.RightsGroup;
import com.kern.academic.dto.RightsNode;

import java.io.IOException;
import java.util.List;

/**
 * Created by caoshi at 7:44 2021-07-13
 */
public interface IRightsService {

    List<RightsDTO> listAll();

    /**
     *  查询所有权限 封装成树形结构
     * @return
     */
    List<RightsNode> listRightsByRoleId(String roleId) throws IOException, ClassNotFoundException;

    /**
     * 查询所有权限组名
     * @return
     */
    List<RightsGroup> listAllGroup() throws IOException, ClassNotFoundException;


    /**
     *  角色授权
     * @param roleId
     * @param rightsIdArray
     * @return
     */
    ResponseResult authorize(String roleId, JSONArray rightsIdArray);


    /**
     *  根据角色id 查询他所有的权限 id
     * @param roleId
     * @return
     */
    List<String> listRightsIdsByRoleId(String roleId);

}
